#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct student
{
	int no;
	char nm[21];
	float sco;
}stu;
int main()
{
   int n,i,good,well,bad;
   while((scanf("%d",&n))!=EOF)
   {
   	  good=0;
   	  well=0;
   	  bad=0;
   	  for(i=0;i<n;i++)
   	  {
   	  	scanf("%d %s\n%f",&stu.no,&stu.nm,&stu.sco);
   	    if(stu.sco>=80)
   	    good++;
   	    else if(stu.sco>=60)
   	    well++;
   	    else
   	    bad++;
	  } 
	  printf("%d %d %d\n",good,well,bad);
   }
   return 0;      
}